Comparing Files

Programmer Studio compares files by first loading each file, (if not already open), as they would be when edited normally. Once loaded, each file is subsequently saved on the PC removing any non-editable text, (line numbers and line tags), identified by the Code Editor template or file compare options. Finally, the file compare utility is invoked to compare the two files based on the compare options.

To compare two files

  1. From the Tools menu, select Compare Files

  2. In the File 1 field, enter the name of the first file to compare

  3. In the File 2 field, enter the name of the second file to compare

  4. From the options, select additional compare settings

  5. Click Compare to start the file comparison

 

Tip

Use the arrow button to the right of the File fields to browse for local or remote filenames or select from a list of currently open files.

The file comparison can be cancelled at any time by pressing the Stop button, or by selecting Stop from the View menu. Programmer Studio provides the following options for the file comparison:

Match case

This setting is passed to the comparison utility as an optional parameter. When selected, characters differing in case will be highlighted. By default this option is not enabled.

Ignore tabs and spaces

This setting is passed to the comparison utility as an optional parameter. When selected, multiple tab and space characters are treated as a single space when comparing lines. By default this option is enabled.

Ignore line numbers

This setting instructs Programmer Studio to remove any detected line numbers from the contents of a file prior to invoking the comparison utility. If either file is opened using a File Type that removes line numbering while editing, this option has no effect.

Specify File Type

This setting overrides the File Type that would normally be assigned to the file, either by the current project or using the file name. This is especially useful when comparing files that would not normally be opened with the correct Code Editor Template, ensuring that differences in non-editable code are not highlighted.